package com.aqie.libfactory.model.db;


import com.aqie.libcommon.model.Author;
import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;

import java.util.Objects;

/**
 * User_Table
 */
@Table(database = AppDatabase.class)
public class User extends BaseDbModel<User> implements Author {


    /**
     * userId : 1355421699175165954
     * username : 李先生1
     * trade : IT
     * position : 产品经理2
     * avatar : null
     * city : 安徽
     * workingYears : 5
     * answerOne : 100个集成商客户
     * answerTwo : 我需要软件架构方面的人才
     * answerThree : 我逻辑很强，善于交谈
     * boolFriend : false
     * boolChat : 1
     */
    @PrimaryKey
    private String userId;
    @Column
    private String username;
    @Column
    private String trade;
    @Column
    private String position;
    @Column
    private String avatar;
    @Column
    private String city;
    @Column
    private Integer workingYears;
    @Column
    private String answerOne;
    @Column
    private String answerTwo;
    @Column
    private String answerThree;
    @Column
    private Boolean boolFriend;
    @Column
    private Integer boolChat;
    @Column
    private String phone;

    private String markName;

    private Integer status;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMarkName() {
        return markName;
    }

    public void setMarkName(String markName) {
        this.markName = markName;
    }

    public User() {
    }

    @Override
    public String getPhone() {
        return phone;
    }

    @Override
    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String getUserId() {
        return userId;
    }

    @Override
    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public void setUsername(String username) {
        this.username = username;
    }

    public String getTrade() {
        return trade;
    }

    public void setTrade(String trade) {
        this.trade = trade;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    @Override
    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public Integer getWorkingYears() {
        return workingYears;
    }

    public void setWorkingYears(Integer workingYears) {
        this.workingYears = workingYears;
    }

    public String getAnswerOne() {
        return answerOne;
    }

    public void setAnswerOne(String answerOne) {
        this.answerOne = answerOne;
    }

    public String getAnswerTwo() {
        return answerTwo;
    }

    public void setAnswerTwo(String answerTwo) {
        this.answerTwo = answerTwo;
    }

    public String getAnswerThree() {
        return answerThree;
    }

    public void setAnswerThree(String answerThree) {
        this.answerThree = answerThree;
    }

    public Boolean isBoolFriend() {
        return boolFriend;
    }

    public void setBoolFriend(Boolean boolFriend) {
        this.boolFriend = boolFriend;
    }

    public Integer getBoolChat() {
        return boolChat;
    }

    public void setBoolChat(Integer boolChat) {
        this.boolChat = boolChat;
    }

    @Override
    public boolean isSame(User old) {
        return this == old || Objects.equals(userId, old.userId);
    }

    @Override
    public boolean isUiContentSame(User old) {
        return this == old || (
                Objects.equals(username, old.username)
                        && Objects.equals(avatar, old.avatar)
                        && Objects.equals(trade, old.trade)
                        && Objects.equals(position, old.position)
                        && Objects.equals(answerOne, old.answerOne)
                        && Objects.equals(answerTwo, old.answerTwo)
                        && Objects.equals(answerThree, old.answerThree)
        );
    }

    @Override
    public String toString() {
        return "User{" +
                "userId='" + userId + '\'' +
                ", username='" + username + '\'' +
                ", trade='" + trade + '\'' +
                ", position='" + position + '\'' +
                ", avatar='" + avatar + '\'' +
                ", city='" + city + '\'' +
                ", workingYears=" + workingYears +
                ", answerOne='" + answerOne + '\'' +
                ", answerTwo='" + answerTwo + '\'' +
                ", answerThree='" + answerThree + '\'' +
                ", boolFriend=" + boolFriend +
                ", boolChat=" + boolChat +
                ", phone='" + phone + '\'' +
                '}';
    }
}
